/*
 * MIT License
 *
 * Copyright (c) 2020 wen.gu <454727014@qq.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/***************************************************************************
 * Name: xerror.cpp
 *
 * Purpose: xerror Base API define and implementation
 *
 * Developer:
 *   wen.gu , 2023-10-24
 *
 * TODO:
 *
 ***************************************************************************/

#include "xbus/core/xthread_pool.h"
#include <vector>

#include "xbus/core/xthread.h"

namespace xbus::core {

class XThreadPool::Impl {
public:
    using ThreadArray = std::vector<XThread::XThreadPtr>;

public:
    ThreadArray workers_;
};


/**
 * stack_size: 0: Use default thread stack size 
 */
XThreadPool::XThreadPool(uint32_t min_capcity /*= 2*/, 
            uint32_t max_capcity /*= 16*/,
            uint32_t idle_time_sec /*= 40*/,
            uint32_t stack_size /*= 0*/) 
    : {

}

XThreadPool::XThreadPool(const std::string& name,
            uint32_t min_capcity /*= 2*/, 
            uint32_t max_capcity /*= 16*/,
            uint32_t idle_time_sec /*= 40*/,
            uint32_t stack_size /*= 0*/) {

}

XThreadPool::~XThreadPool() {

}

/**priority == 0 : use default thread priority */
bool XThreadPool::start(int32_t priority /*= 0*/) {

}

bool XThreadPool::stop() {

}

bool XThreadPool::is_started() {

}


bool XThreadPool::addTask(TaskRunnable task){
    
}

} //namespace xbus::core